In the international standard dynamic image encoding methods, such as MPEG-2, MPEG-4, H.263, and H.264, inter-frame prediction coding is employed, in order to realize high encoding efficiency using a correlation in a time direction. The coding mode of a frame includes an I frame which is encoded without using inter-frame correlation, a P frame which is predicted from the I frame encoded in the past, and a B frame which can be predicted from two frames encoded in the past. The I frame is called an intra-frame independent frame, the P frame is called a unidirectional predictive frame, and the B frame is called a bidirectional predictive frame.
In the inter-frame prediction coding, the motion-compensated reference image (predicted image) is subtracted from a dynamic image, and a prediction residual after the subtraction is encoded. Coding process includes processing of orthogonal transform such as DCT (discrete cosine transform), quantization, and variable-length coding. Motion compensation (motion correction) includes processing of moving a reference frame of the inter frame prediction spatially. The processing of motion compensation is performed in units of blocks of a frame to be encoded. When there is no motion in an image content, there is no movement and a pixel at the same position as a pixel to be predicted is employed. When there is a motion, a most analogous block is searched for and the movement amount is defined as a motion vector. A block of motion compensation is a block of 16 pixels×16 pixels or 16 pixels×8 pixels in the MPEG-2 encoding method, a block of 16 pixels×16 pixels or 8 pixels×8 pixels in the H.263 encoding method, a block of 16 pixels×16 pixels, 16 pixels×8 pixels or 8 pixels×8 pixels in the MPEG-4 encoding method, and a block of 16 pixels×16 pixels, 16 pixels×8 pixels, 8 pixels×16 pixels, 8 pixels×8 pixels, 8 pixels×4 pixels, 4 pixels×8 pixels, or 4 pixels×4 pixels in the H.264 encoding method.
In the MPEG-2 encoding method, since the motion vector is not allowed to depart from the inside of a screen, the MPEG-2 encoding method has a drawback that accurate motion compensation is not possible when an actual motion occurs from the outside of the screen. On the contrary, in the encoding methods of MPEG-4, H.263, and H.264, an unrestricted motion vector is adopted, which allows motion compensation from a peripheral area outside the screen.
On the other hand, Patent Literature 1 cited below describes that a reference image output means which outputs a motion compensated pixel to a motion vector is provided with a peripheral pixel prediction means which predicts a peripheral pixel of a reference image, so that it is possible to detect a motion vector by which a part of a block of a prediction pixel or a block of a motion compensated pixel indicates the outside of the reference image.
Patent Literature 1 describes also that an extended reference image as a peripheral image of the reference image is given by a mean value of all the pixel values of the reference image or by a pixel value of the closest reference image.